const express=require('express')
const router=express.Router()

//导入验证表单数据中间件和验证规则对象
const expressJoi=require('@escook/express-joi')
const {add_cate_sechma,delete_cate_sechma,get_cate_sechma,update_cate_sechma}=require('../schema/artcate')

const artcate_handler=require('../router_handler/artcate')
router.get('/cates',artcate_handler.getArtcateCates)
router.post('/addcates',expressJoi(add_cate_sechma),artcate_handler.addArtcateCates)
router.get('/deletecates/:id',expressJoi(delete_cate_sechma),artcate_handler.deleteArtcateCates)
router.get('/cates/:id',expressJoi(get_cate_sechma),artcate_handler.getArtcateById)
router.post('/updatecate',expressJoi(update_cate_sechma),artcate_handler.updateArtcateCate)

module.exports=router